<template>
  <div class="col-xs-18 col-xs-offset-8 main">
    <div class="content-main">
      <ul class="note-list">
        <div class="itemlist-box" v-for="ITTtem in ITDataList " :key="ITTtem.id">
          <div class="content">
            <router-link to="/detail" target="_blank" class="title"
              >{{ITTtem.title}}</router-link>
            <div class="abstract">{{ITTtem.desc}}</div>
            <div class="meta">
              <span class="jsd-meta">
                <i class="iconfont icon-diamond">{{ITTtem.amount}}</i>
              </span>
              <a href="#" target="_blank" class="nickname"
                >{{ITTtem.user.nickname}}</a>
              <a href="#">
                <i class="iconfont icon-comments">{{ITTtem.comments_count}}</i>
              </a>
              <span>
                <i class="iconfont icon-likefill">{{ITTtem.likes_count}}</i>
              </span>
            </div>
          </div>
        </div>
      </ul>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "Content",
  props: ["type"],
  data() {
    return {
      
    };
  },
  mounted() {
    this.getITDataList();
  },
  methods: {
    getITDataList() {
      const { type } = this;
      if (type === 1 || type === undefined) {
        //请求前端数据
        this.$store.dispatch("getBackEndList", type);
      } else if (type === 2) {
        //请求后端数据
        this.$store.dispatch("getFrontEndList", type);
      }
      else if(type === 3){
        //请求Andriod数据
        this.$store.dispatch('getAndriodList',type)
      }
      else if(type === 4){
        //请求IOS数据
        this.$store.dispatch('getIOSList',type)
      }
      else if(type === 5){
        //请求AI数据
        this.$store.dispatch('getAiList',type)
      }
      else if(type === 6){
        //请求数据库数据
        this.$store.dispatch('getDataBaseList',type)
      }
      else{
        //请求开发程序数据
        this.$store.dispatch('getProgramList',type)
      }
    },
  },
  computed: {
    ...mapState({
      ITDataList: (state) => state.IT.ITDataList,
    }),
  },
  watch: {
    
  },
};
</script>

<style lang="less" scoped>
.col-xs-offset-8 {
  margin-left: 33.33333%;
}
.col-xs-18 {
  width: 75%;
  float: left;
  .content-main {
    .note-list {
      margin-top: 0px;
      margin-bottom: 10px;
      list-style: none;
      .itemlist-box {
        position: relative;
        width: 100%;
        margin: 0 0 15px;
        padding: 15px 2px 20px 0;
        border-bottom: 1px solid #f0f0f0;
        word-wrap: break-word;
        box-sizing: border-box;
        .content {
          .title {
            color: #333;
            margin: -7px 0 4px;
            display: inherit;
            font-size: 18px;
            font-weight: 700;
            line-height: 1.5;
            &:hover {
              text-decoration: none;
            }
          }
          .abstract {
            margin: 0 0 8px;
            font-size: 13px;
            line-height: 24px;
            color: #999;
          }
          .meta {
            font-size: 12px;
            font-weight: 400;
            line-height: 20px;
            .jsd-meta {
              margin-right: 10px;
              color: #ea6f5a;
              i {
                font-size: 12px;
                font-weight: normal !important;
              }
            }
            a {
              margin-right: 10px;
              color: #b4b4b4;
              text-decoration: none;
              i {
                font-size: 12px;
                font-weight: normal !important;
              }
            }
            span {
              margin-right: 10px;
              color: #b4b4b4;
              i {
                font-size: 12px;
                font-weight: normal !important;
              }
            }
          }
        }
      }
    }
  }
}
</style>
